//package com.bussiness.controller;
//
//import com.common.response.ResponseBean;
//import com.common.response.impl.BaseResponseImpl;
//import com.hbase.model.InsertHbaseValueDto;
//import com.hbase.util.HbaseAdmin;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.Map;
//
///**
// * @description: hbaseTest
// * @author: zyj
// * @create: 2019-12-13 10:50
// **/
//@RestController
//@Api(tags={"hbase测试"})
//@RequestMapping("/hbase")
//public class HbaseController extends BaseResponseImpl {
//
//    @Autowired
//    private HbaseAdmin hbaseAdmin;
//
//    @ApiOperation(value="创建表")
//    @RequestMapping(value = "/createIndex", method = RequestMethod.PUT)
//    public ResponseBean createTable(@ApiParam(value = "表名") @RequestParam String tableName, @ApiParam(value = "列簇") @RequestParam String[] columnFamily){
//        int i = hbaseAdmin.createOneTable(tableName, columnFamily);
//        return successData(i);
//    }
//
//    @ApiOperation(value="获取所有表")
//    @RequestMapping(value = "/getAllTable", method = RequestMethod.GET)
//    public ResponseBean getAllTable(){
//        List<String> tables = hbaseAdmin.getAllTableNames();
//        return successData(tables);
//    }
//
//    @ApiOperation(value="删除表")
//    @RequestMapping(value = "/deleteTable", method = RequestMethod.DELETE)
//    public ResponseBean deleteTable(@ApiParam(value = "表名") @RequestParam String tableName){
//        boolean b = hbaseAdmin.deleteTable(tableName);
//        return successData(b);
//    }
//
//    @ApiOperation(value="插入单条数据")
//    @RequestMapping(value = "/insertOneColumnRecords", method = RequestMethod.PUT)
//    public ResponseBean insertOneColumnRecords(@ApiParam(value = "表名") @RequestParam String tableName, @ApiParam(value = "行号") @RequestParam String row,
//                                               @ApiParam(value = "列族") @RequestParam String columnFamily,@ApiParam(value = "列名") @RequestParam String column,
//                                               @ApiParam(value = "列值") @RequestParam String value){
//        boolean b = hbaseAdmin.insertOneColumnRecords(tableName, row, columnFamily, column, value);
//        return successData(b);
//    }
//
//    @ApiOperation(value="查询表中所有数据信息")
//    @RequestMapping(value = "/selectTableAllDataMap", method = RequestMethod.GET)
//    public ResponseBean selectTableAllDataMap(String tableName){
//        List<Map<String,Object>> list = hbaseAdmin.selectTableAllDataMap(tableName);
//
//        return successData(list);
//    }
//
//    @ApiOperation(value="删除表中一条记录")
//    @RequestMapping(value = "/deleteDataByRowNumber", method = RequestMethod.DELETE)
//    public ResponseBean deleteDataByRowNumber(String tableName,String rowNumber){
//        boolean b = hbaseAdmin.deleteDataByRowNumber(tableName, rowNumber);
//        return successData(b);
//    }
//
//    @ApiOperation(value="插入（单行单列族-多列多值)")
//    @RequestMapping(value = "/insertManyColumnRecords", method = RequestMethod.PUT)
//    public ResponseBean insertManyColumnRecords(@RequestBody InsertHbaseValueDto insertValueDto){
//        boolean b = hbaseAdmin.insertManyColumnRecords(insertValueDto);
//        return successData(b);
//    }
//
//    @ApiOperation(value="根据表名和行号查询数据")
//    @RequestMapping(value = "/selectOneRowDataMap", method = RequestMethod.GET)
//    public ResponseBean selectOneRowDataMap(String tableName,String rowNumber){
//        Map<String, Object> result = hbaseAdmin.selectOneRowDataMap(tableName, rowNumber);
//        return successData(result);
//    }
//
//    @ApiOperation(value="分页查询表中所有数据信息")
//    @RequestMapping(value = "/selectTableAllDataMapPage", method = RequestMethod.GET)
//    public ResponseBean selectTableAllDataMapPage(String tableName,int pageSize){
//        List<Map<String,Object>> result = hbaseAdmin.selectTableAllDataMapPage(tableName, pageSize);
//        return successData(result);
//    }
//
//
//}
